<!--
 @description 购物车-空数据提示
 @fileName index.vue
 @author zengqiongying
 @created 2022/07/30 16:30:18
-->
<template>
  <div class="cart-cell">
    <div class="cart-empty" :style="heightStyle">
      <img src="~@/assets/my/cart-empty.png" class="img">
      <div class="txt">购物车是空的 请先选购吧</div>
      <div class="btn-go" @click="handleClickToPro">去逛逛</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CartEmpty',
  props: {
    topMargin: {
      type: Number,
      default: 108 // 距离顶部距离
    },
    bottomMargin: {
      type: Number,
      default: 108 // 底部距离
    }
  },
  data() {
    return {

    }
  },

  computed: {
    heightStyle() {
      return {
        'height': `calc( 100vh - ${this.topMargin}px - ${this.bottomMargin}px )`
      }
    }
  },

  created() {},
  activated() {},

  mounted() {},

  methods: {
    handleClickToPro() {
      this.$router.replace({
        name: 'GoodsIndex'
      })
    }
  }
}

</script>
<style lang='less' scoped>
  .cart-cell{
    padding: 0 16px;
  }
  .cart-empty{
    position: relative;
    z-index: 9;
    margin-top: -40px;
    width: 100%;
    height: calc(100vh - 170PX);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .img{
      width: 160px;
      height: 136px;
    }
    .txt{
      font-size: 14px;
      font-weight: 600;
      color: #7E89A4;
      line-height: 20px;
      text-align: center;
      margin: 25px 0;
    }
    .btn-go{
      width: 80px;
      height: 30px;
      background: linear-gradient(90deg, #00D5C0 0%, #05C4C3 100%);
      border-radius: 12px;
      color: #fff;
      font-size: 16px;
      line-height: 30px;
      text-align: center;
    }
  }
</style>
